<?php
$type = DOCTYPE_DISPATCH;
Yii::app()->clientScript->registerScript('list', <<<DOCHERE
       var dispatch= '$model->dispatch';    
       var locno=null;
       var custno=null;
       var type= $type;
DOCHERE
    , CClientScript::POS_HEAD); ?>

<?php Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/js/app/customerPortal/dispatchupdate.js', CClientScript::POS_END); ?>
<?php Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/js/app/customerPortal/dispatchnotes.js', CClientScript::POS_END); ?>
<?php Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/js/app/customerPortal/dispatchtech.js', CClientScript::POS_END); ?>

<div id="left-col">
    <?php $this->renderPartial("_side", array(
    'location' => $model->location,
    'dispatch' => $model,
    'customer' => $model->location->customer
));
    ?>


</div>

<div id="right-col">

    <div class="wrap">
        <div class="container">


            <div id="breadcrumb" style="display:none;"><span style="padding-left:10px;font-size:10px;color:#777777;"
                                                             id="alsoviewing"></span></div>
            <div class="inside">


                <br/>
                <ul id="tab" class="tabs tabs-with-summary">
                    <li class="active"><a class="atab" href="#info">Dispatch Info</a></li>
                    <li><a class="atab" href="#tech">Technicians</a></li>
                    <li><a class="atab" href="#notes">Customer Notes</a></li>
                    <li><a class="atab" href="#technotes">Tech Notes</a></li>
                   
                    <?php if (is_null($model->complete)): ?>
                    <li><a class="atab" href="#track" id="tracking">Email tracking</a></li>
                    <?php else: ?>
                    <li><a class="atab" href="#feedback">Feedback</a></li>
                    <?php endif; ?>
                </ul>
                <br/>

                <div id="info">
                    <?php $this->renderPartial('_form', array(
                    'model' => $model,
                ));?>
                </div>


            </div>
            <div id="tech">


                <div id="tech-list">

                </div>

            </div>
            <div id="notes">
                <?php if (is_null($model->complete)): ?>
                <a class="add-button" id="createNote">Add Note</a>
                <?php else: ?>
                <a id="createNote"></a>

                <?php endif; ?>


                <div id="notes-list">

                </div>

            </div>
            <div id="technotes">


                <div id="tech-notes-list">

                </div>

            </div>            
		
            <?php if (is_null($model->complete)): ?>
            <div id="track">
                <?php $this->renderPartial('_track', array(
                'model' => $model,
            ));?>


            </div>
            <?php else: ?>
            <div id="feedback">

                feedback

            </div>
            <?php endif; ?>


        </div>
        <!-- inside -->
    </div>
    <!-- container -->
</div>
<!-- wrap -->
<?php $this->renderPartial('application.views.copyright'); ?>
</div> <!-- left-col -->

